led.bin: start.o led.o
	arm-linux-ld -Ttext 0x0C000000 -o led.elf $^
	arm-linux-objcopy -O binary led.elf $@
	arm-linux-objdump -D led.elf > led.dis
	
%.o : %.c
	arm-linux-gcc -c $< -o $@
%.o : %.S
	arm-linux-gcc -c $< -o $@
	
.PHONY:install
	umount /dev/mmcblk0p1
	sudo dd if=./led.bin of=/dev/mmcblk0 seek=8059870208 bs=1

.PHONY: clean
clean:
	rm *.o *.elf *.bin *.dis


